ADFA-3462 | Add Get AI Models plugin - #55
Merged
Merged
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
jatezzz
requested review from
a team,
Daniel-ADFA,
dara-abijo-adfa,
davidschachterADFA,
hal-eisen-adfa and
itsaky-adfa
July 30, 2026 17:12
hal-eisen-adfa
approved these changes
Jul 30, 2026
…ecksum-gated downloads Bottom-drawer tab listing 11 curated fully-open GGUF files; downloads via DownloadManager to /sdcard/Download and keeps one only if its pinned SHA-256 matches. Verified files are remembered across restarts and revalidated by stat.
jatezzz
force-pushed
the
feature/ADFA-3462-get-ai-models-plugin
branch
from
July 31, 2026 15:05
f211db9 to
c7b46ef
Compare
hal-eisen-adfa
added a commit
that referenced
this pull request
Aug 6, 2026
Two plugins landed on main after this branch was cut, so they were never standardized: - project-to-template (#56): compileSdk/targetSdk 34 -> 36 - get-ai-models (#55): Kotlin 2.1.0 -> 2.3.0 Both get-ai-models and template-manager pin Kotlin twice: the kotlin-gradle-plugin classpath in settings.gradle.kts, and `kotlin` in gradle/libs.versions.toml, which drives libs.kotlin.stdlib. The catalog comment states the two must match, so both were bumped. That surfaced a defect in this branch: it had already bumped template-manager's classpath to 2.3.0 but left its catalog at 2.1.0, so the compiler and stdlib disagreed. Fixed here. Verified: all 27 plugins now report compileSdk/targetSdk 36, AGP 8.11.0, Kotlin 2.3.0, with no catalog left at an older pin. All four affected plugins build assemblePlugin successfully; kotlin-stdlib resolves to 2.3.0 in get-ai-models and template-manager, and the packaged manifests of project-to-template and get-ai-models report targetSdkVersion=36.
hal-eisen-adfa
added a commit
that referenced
this pull request
Aug 7, 2026
…P 8.11.0, Kotlin 2.3.0, Gradle 8.14.3 (#54) * ADFA-4907 | Standardize plugin toolchain: compileSdk/targetSdk 36, AGP 8.11.0, Kotlin 2.3.0, Gradle 8.14.3 Aligns all 25 example plugins with Code On The Go's on-device build toolchain (verified on device: CoGo ships only android-36, AGP 8.11.0, Gradle 8.14.3; does not pin Kotlin). Relevant because plugins are being built with CoGo itself (ADFA-4693). - compileSdk & targetSdk -> 36 (22 plugins; 3 template installers already 36) - AGP -> 8.11.0 (ai-assistant, ai-core from 8.13.2; client-time-tracker, compose-preview, layout-editor from 8.8.2 -- downgrades intentional, match CoGo) - Kotlin -> 2.3.0 (flutter-template, pebble, template-manager from 2.1.0) - Gradle wrapper -> 8.14.3 (ai-assistant, ai-core from 8.14.4; client-time-tracker, compose-preview, layout-editor from 8.10.2) - template-manager: migrate deprecated kotlinOptions.jvmTarget string DSL to compilerOptions { jvmTarget.set(JvmTarget.JVM_17) } (required by Kotlin 2.3.0) Java/jvmTarget already uniform at 17. 20/25 plugins build clean. 5 (ai-assistant, ai-core, code-suggestions-plugin, speech-to-text-plugin, vector-search-plugin) fail with pre-existing unresolved-reference errors (stale libs/plugin-api.jar, missing newer API symbols) -- verified failing at baseline before this change, out of scope here. * ADFA-4907 | Extend toolchain standardization to 3 missed plugins Two plugins landed on main after this branch was cut, so they were never standardized: - project-to-template (#56): compileSdk/targetSdk 34 -> 36 - get-ai-models (#55): Kotlin 2.1.0 -> 2.3.0 Both get-ai-models and template-manager pin Kotlin twice: the kotlin-gradle-plugin classpath in settings.gradle.kts, and `kotlin` in gradle/libs.versions.toml, which drives libs.kotlin.stdlib. The catalog comment states the two must match, so both were bumped. That surfaced a defect in this branch: it had already bumped template-manager's classpath to 2.3.0 but left its catalog at 2.1.0, so the compiler and stdlib disagreed. Fixed here. Verified: all 27 plugins now report compileSdk/targetSdk 36, AGP 8.11.0, Kotlin 2.3.0, with no catalog left at an older pin. All four affected plugins build assemblePlugin successfully; kotlin-stdlib resolves to 2.3.0 in get-ai-models and template-manager, and the packaged manifests of project-to-template and get-ai-models report targetSdkVersion=36. * ADFA-4907 | Enforce the standard toolchain in CI Adds scripts/check-toolchain.sh and a pull_request-triggered workflow that fails the build when any Gradle module drifts off the ADFA-4907 standard (compileSdk/targetSdk 36, AGP 8.11.0, Kotlin 2.3.0, Gradle 8.14.3-bin, Java 17). Until now nothing enforced this. Both existing workflows are workflow_dispatch-only, so a PR could move any of these values with zero CI signal — which is how origin/main still carries compileSdk 33/34/35, AGP 8.8.2/8.13.2 and Gradle 8.10.2. The check is pure text inspection (no JDK, no Gradle, no network), so it runs in seconds and is cheap to require. It walks every build.gradle.kts, including subprojects. The earlier sweep enumerated only top-level plugin folders, which is why ai-core/llama-impl kept compileSdk = 34 through a dedicated standardization pass. Files under src/main/assets/ are excluded: those are project templates that Code On The Go stamps out for the user's own app, not our builds. minSdk is deliberately not checked — it legitimately varies (21 template installers, 26 most, 28 Beepy/sketch-to-ui, 33 the AI plugins). Also fixes the nine violations the check found, so it lands green: * kotlin-stdlib pinned behind the Kotlin plugin -> 2.3.0 (flutter-template, bookshelf, ndk-installer-plugin, cotg-ndk, pebble) * ai-core/llama-impl compileSdk 34 -> 36 * ai-assistant + ai-core wrapper -all.zip -> -bin.zip * ai-core catalog agp "8.13.2" -> "8.11.0" (contradicted settings.gradle.kts) * ADFA-4907 | Simplify check-toolchain.sh Collapses the nine copy-pasted "extract, compare, report" blocks into two helpers (check_value for first-match keys, check_every for all-match keys), plus small file_matches/reject/module_of helpers. That duplication had already caused a real defect: four of the nine copies omitted the --list echo, so --list silently under-reported the compose-compiler pin, the wrapper bin/all flavor, and both catalog entries. Recording the value is now part of the helper, so it cannot be forgotten. --list goes from 5 fact types / 134 lines to 9 / 164, sorted by module instead of grouped by internal scan order. Also: * One matching idiom. The header claimed grep|sed was avoided for BSD sed portability, then the kotlin-stdlib check used exactly that. Everything is bash =~ now, so the claim is true and no subprocesses are spawned. * One find traversal with a case dispatch instead of four full walks of the 12.8k-entry tree. Runtime 1.02s -> 0.38s. * Documents why discovery is deliberately broader than plugin_dirs() in .githooks/pre-push, so a future "DRY win" does not silently drop ai-core/llama-api and llama-impl from coverage. * Narrows the --list usage text, which overstated what it prints. * Workflow header no longer restates the version numbers (third copy). Deliberately NOT changed: no declarative rules table (four of the checks have genuinely different shapes and a table would gut the failure-message hints), and the standard stays a set of literal constants rather than being derived from the root wrapper -- deriving it would make a wrong root wrapper undetectable. * ADFA-4907 | Align dependency versions across the AI plugins The toolchain check enforces compileSdk/AGP/Kotlin/Gradle/Java, but every other library version is unchecked, and the AI plugins had drifted as a group -- all four kotlinx-coroutines 1.7.3 pins in the repo were AI plugins, against a repo majority of 1.8.1. Library alignments (all upgrades to the repo majority): * kotlinx-coroutines 1.7.3 -> 1.8.1 in ai-core, code-suggestions-plugin, speech-to-text-plugin, vector-search-plugin; -test 1.7.3 -> 1.8.1 in ai-assistant; get-ai-models catalog 1.6.4 -> 1.8.1 (was the oldest pin in the repo) * androidx.lifecycle 2.6.2 -> 2.8.7 in code-suggestions-plugin, speech-to-text-plugin and the get-ai-models catalog, matching client-time-tracker / compose-preview / sketch-to-ui * ai-assistant fragment-ktx 1.6.2 -> 1.8.8. This was the only 1.6.2 in the repo against 17 modules on 1.8.8, and the comment directly above it claimed the block matched random-xkcd, sketch-to-ui-plugin and Beepy -- all three of which are on 1.8.8. The comment is now true. * ai-assistant org.json 20231013 -> 20240303 Deliberately NOT changed: coordinates where the AI plugins are merely AHEAD of the majority (get-ai-models material 1.12.0, ai-literacy webkit 1.11.0, llama-impl slf4j 2.0.12). Being ahead is not a defect, and downgrading carries real risk for no gain. ai-core/gradle/libs.versions.toml: pruned 334 lines -> 40. It was copied wholesale from the CodeOnTheGo app repo and declared 281 entries of which exactly 4 were ever referenced (98.6% dead). The dead bulk had drifted into self-contradiction -- androidx.core:core-ktx declared at three different versions, appcompat at two, gson at two, plus a malformed ksp = "2.3.6" and typo'd keys ("anroidx"). That is not inert: it is the number the next person greps for. While pruning, the two surviving aliases that encoded their version in the NAME (androidx-core-ktx-v1120, androidx-appcompat-v171) were renamed to version-neutral names, since such a name lies the moment the version moves. Call sites in llama-impl updated to match. The catalog also resolved two real conflicts inside a single Gradle build: appcompat was 1.7.1 there while ai-core/build.gradle.kts pinned 1.6.1, and llama-api pulled coroutines-core 1.10.2 while ai-core pulled coroutines-android 1.8.1 -- the coroutines artifacts are released as a set and must not be split. Verified: all six changed AI plugins build assemblePluginDebug clean and emit a .cgp. Resolved classpaths confirm coroutines is now uniformly 1.8.1 in ai-core (previously split), lifecycle 2.8.7, fragment-ktx 1.8.8. The renamed catalog aliases were verified by forcing llama-api/llama-impl into the build, with a negative control proving an unknown alias fails loudly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new plugin, Get AI Models, that contributes a tab to the project editor's bottom drawer for downloading small GGUF language-model files.
src/main/assets/catalog/models.json) with 6 curated entries, all under 1 GB. One row = one file (a model at one quantization); tapping a row expands publisher, licence, minimum RAM, context window, and a strengths/weaknesses note. No remote catalog, a revised list ships as a new plugin version.DownloadManagerinto/sdcard/Download, plugin-scoped so closing the tab doesn't abandon them. Paused states are surfaced rather than hidden (Paused, waiting for Wi-Fi).file://URI →COLUMN_LOCAL_FILENAME→content://) becauseCOLUMN_LOCAL_URIis not guaranteed to be a filesystem path on newer platforms; a naiveFile(uri.path)failed otherwise-good downloads.entryId → {absolutePath, sizeBytes, verifiedAt}), revalidated with a singlestaton activation so aDownloadedbadge is never shown without the disk agreeing. Expanded rows offer Verify file again and Delete file (destructive, confirms first, deletes only the recorded path).Download only, loading or running a model stays with the llama.cpp-based AI plugins. This plugin never loads a model and never reads device RAM.
Also wires the plugin into
README.md's Examples table and theMAParray in.github/workflows/update-libs.ymlso it ships to the website.Details
values-night/colors.xmland the plugin inflater, no hardcoded colors.DocumentationExtensionentries (tab, row, Download / Cancel / Verify / Delete) under categoryplugin_org.appdevforall.getaimodels, with the tab's tooltip linking the bundled offline guide atsrc/main/assets/docs/index.html.../gradlew test) cover the catalog loader (re-validating the shipped asset), download-state transitions, the three-tier path resolver, the file gate, and the verified-model store.libs/jars, no per-plugin wrapper or jars.network.access,filesystem.read,filesystem.write. No native code, no system commands, no IDE settings, no project-structure access.plugin.min_ide_version/max_ide_version:26.29–26.31.document_5139137749319681813.mp4
Ticket
ADFA-3462
Observation
Two items worth flagging, all documented in
get-ai-models/README.mdanddocs/CURATION.md: